i = 1
while i <= 9:
    j = 1
    while j <= 9:
        if i>=j:
            sum = i*j
            print('{}*{}={:<4}'.format(i,j,sum),end='')
        j+=1
    print('')
    i+=1
print('-'*100)
i = 1
while i <= 9:
    j = 1
    while j <= 9:
        if i<=j:
            sum = i*j
            print('{}*{}={:<4}'.format(i,j,sum),end='')
        j+=1
    print('')
    i+=1
print('-'*100)
i = 1
while i <= 9:
    space = 1
    while space <= 9-i:
        print('        ',end = '')
        space += 1
    j = 1
    while j <= i:
        print('{}*{}={:<4}'.format(i, j, i*j), end='')
        j += 1
    i += 1
    print()
print('-'*100)
i = 9
while i >= 1:
    space = 1
    while space <= 9-i:
        print('        ',end = '')
        space += 1
    j = 1
    while j <= i:
        print('{}*{}={:<4}'.format(i, j, i*j), end='')
        j += 1
    i -= 1
    print()

